﻿using System.ComponentModel;

namespace Oxage.Models
{
	public class FindViewModel : INotifyPropertyChanged
	{
		#region Public properties
		public string FindText
		{
			get
			{
				return this.findText;
			}
			set
			{
				if (this.findText != value)
				{
					this.findText = value;
					OnPropertyChanged("FindText");
				}
			}
		}
		private string findText;

		public string ReplaceText
		{
			get
			{
				return this.replaceText;
			}
			set
			{
				if (this.replaceText != value)
				{
					this.replaceText = value;
					OnPropertyChanged("ReplaceText");
				}
			}
		}
		private string replaceText;

		public bool MatchCase
		{
			get
			{
				return this.matchCase;
			}
			set
			{
				if (this.matchCase != value)
				{
					this.matchCase = value;
					OnPropertyChanged("MatchCase");
				}
			}
		}
		private bool matchCase;

		public bool SearchUp
		{
			get
			{
				return this.searchUp;
			}
			set
			{
				if (this.searchUp != value)
				{
					this.searchUp = value;
					OnPropertyChanged("SearchUp");
				}
			}
		}
		private bool searchUp;

		public bool InSelection
		{
			get
			{
				return this.inSelection;
			}
			set
			{
				if (this.inSelection != value)
				{
					this.inSelection = value;
					OnPropertyChanged("InSelection");
				}
			}
		}
		private bool inSelection;

		public bool IsRegex
		{
			get
			{
				return this.isRegex;
			}
			set
			{
				if (this.isRegex != value)
				{
					this.isRegex = value;
					OnPropertyChanged("IsRegex");
				}
			}
		}
		private bool isRegex;
		#endregion

		#region INotifyPropertyChanged Members
		public event PropertyChangedEventHandler PropertyChanged;
		protected virtual void OnPropertyChanged(string propertyName)
		{
			if (PropertyChanged != null)
			{
				PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}
		#endregion
	}
}
